package com.hgshop.yudongyang.controller;

import java.util.List;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hgshop.yudongyang.domain.Category;
import com.hgshop.yudongyang.service.CategoryService;

@Controller

public class IndexController {

	
	@Reference
	CategoryService CategoryService;
	
	@RequestMapping(value = {"/","","index"})
	public String index(Model model) {
		List<Category> cats = CategoryService.getTree(0);
		model.addAttribute("cats", cats);
		
		return "index";
	}
}
